#ifndef CSTRUCTURE_H
#define CSTRUCTURE_H

#include <string.h>
#include <stdio.h>
#include "parameters.h"
#include "CBeam.h"


class CStructure
{
    public:
        CStructure();
        virtual ~CStructure();
        void addBeam(CBeam *b);
        void assemble();
        void solve();
        void solveOptimized();
        void createUnknownMatrix();
        void parseMosekSolution();
        void parseInputFile(char filename[255]);
        void addNode(CNode *n);
        void writeAnsysFile(char filename[255]);
    protected:
    private:
        int nBeams;
        int nNodes;
        int nUnknownForces;
        CBeam *beams[MAX_BEAMS];
        CNode *nodes[MAX_NODES];
        int unknownForces[MAX_NODES];
        double unknownForcesValue[MAX_NODES];
        int nActiveUnknownForces;
        CMatrix *K;
        CMatrix *rhs;
        CMatrix *solution;
        CMatrix *unknownMatrix;
};

#endif // CSTRUCTURE_H
